import request from './request'
// 新增开关
export const switchDeviceAdd = (addSwitchDevice) => {
  return request({
    url: '/switchDevice/add',
    method: 'post',
    data: addSwitchDevice,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 开关列表
export const switchDeviceList = (param) => {
  return request({
    url: '/switchDevice/list',
    method: 'get',
    param,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 开关详情
export const switchDeviceDetail = (deviceId) => {
  return request({
    url: '/switchDevice/detail',
    method: 'get',
    param: {
      deviceId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改开关
export const switchDeviceUpdate = (updateSwitchDevice) => {
  return request({
    url: '/switchDevice/update',
    method: 'post',
    data: updateSwitchDevice,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
